import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

Item {
    id: configSystemBack_Window
    width: 1770
    height: 1010


    property real button_Width: 180
    property real button_Height: 60
    property real buttonFontPixle: 20
    property int currentPage

    Rectangle{
        anchors.fill: parent
        gradient: Gradient{

            orientation: Gradient.Vertical
            GradientStop { position: 0.0 ; color: "#FFFFFF"}
            GradientStop { position: 0.5 ; color: "#1E90FF"}
            GradientStop { position: 1.0 ; color: "#FFFFFF"}
        }
    }

    Component.onCompleted: {
        if(Cpp_PLC.Log_Flag)
        {
            currentPage = 1
            parameterLoader.source = "Config_ConfigWindow.qml"
        }
    }

    Row{
        anchors.left: configSystemBack_Window.left
        anchors.leftMargin: 5
        anchors.top: configSystemBack_Window.top
        anchors.topMargin: 5
        spacing: 5

        A_Button{
            buttonWidth: button_Width
            buttonHeight: button_Height
            contentText_Data: qsTr("配置调节")
            isSelected: currentPage === 1

            onButtonClicked: {

                if(Cpp_PLC.Log_Flag)
                {
                    currentPage = 1
                    parameterLoader.source = "Config_ConfigWindow.qml"
                }
            }

        }
        // A_Button{
        //     buttonWidth: button_Width
        //     buttonHeight: button_Height
        //     contentText_Data: qsTr("加密")
        //     isSelected: currentPage === 2

        //     onButtonClicked: {
        //         currentPage = 2
        //         parameterLoader.source = "MechineParameter_ParameterWindow.qml"
        //     }

        // }

    }


    Loader{         // 设备配置加载
        id: parameterLoader
        anchors.top: configSystemBack_Window.top
        anchors.topMargin: 70
        anchors.horizontalCenter: configSystemBack_Window.horizontalCenter

        onSourceChanged: {
            console.log("当前设备配置界面为: " + source)
        }
    }



}
